package com.aurora_manito.xiaomi.service.impl;

import com.aurora_manito.xiaomi.entity.GoodsType;
import com.aurora_manito.xiaomi.mapper.GoodsTypeMapper;
import com.aurora_manito.xiaomi.service.GoodsTypeService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Aurora_Manito
 * @since 2020-05-27
 */
@Service
public class GoodsTypeServiceImpl extends ServiceImpl<GoodsTypeMapper, GoodsType> implements GoodsTypeService {
    @Autowired
    private GoodsTypeMapper goodsTypeMapper;
    private QueryWrapper<GoodsType> goodTypeWapper=new QueryWrapper<>();
    private Map<String,Object> condition=new HashMap<>();
    //根据类型等级查询
    public List<GoodsType> getTypeByLevel(int i) {
        condition.put("level",i);
        List<GoodsType> goodsTypeList=goodsTypeMapper.selectByMap(condition);
        System.out.println(goodsTypeList);
        return goodsTypeList;
    }
}
